const isDev = process.env.NODE_ENV === 'development'
const APIV1 = isDev ? '/api/dev' : '/api/v1'

module.exports = {
  name: 'Eclogue',
  prefix: 'eclogue',
  footerText: 'devops eclogue © 2019 ecloguelabs',
  logo: '/assets/logo.jpeg',
  iconFontCSS: '/assets/iconfont.css',
  iconFontJS: '/assets/iconfont.js',
  CORS: [],
  openPages: ['/login'],
  apiPrefix: '/api/v1',
  api: {
    menus: `${APIV1}/menus`,
    userLogin: `${APIV1}/login`,
    playbookDumper: `${APIV1}/playbook/dumper`,
    playbookEdit: `${APIV1}/playbook/dumper`,
    getPlaybookFile: `${APIV1}/playbook/edit/:id`,
    renamePlaybookFile: `${APIV1}/playbook/rename/:id`,
    getDevices: `${APIV1}/cmdb/devices`,
    getDevice: `${APIV1}/cmdb/devices/:id`,
    delDevice: `${APIV1}/cmdb/devices/:id`,
    playbookUpload: `${APIV1}/playbook/upload`,
    playbookAddFolder: `${APIV1}/playbook/folder`,
    playbookTags: `${APIV1}/playbook/tags`,
    allBooks: `${APIV1}/books/all`,
    playbooks: `${APIV1}/books/{name}/playbooks`,
    inventory: `${APIV1}/books/{name}/inventory`,
    roles: `${APIV1}/books/{id}/roles`,
    entry: `${APIV1}/books/{id}/entries`,
    checkTask: `${APIV1}/tasks`,
    addInventory: `${APIV1}/cmdb/inventory`,
    editInventory: `${APIV1}/cmdb/inventory/:id`,
    searchUsers: `${APIV1}/search/users`,
    updateInventory: `${APIV1}/inventory/:id`,
    getRegions: `${APIV1}/cmdb/regions`,
    addRegions: `${APIV1}/cmdb/regions`,
    editRegions: `${APIV1}/cmdb/regions/:id`,
    getGroups: `${APIV1}/cmdb/groups`,
    addGroups: `${APIV1}/cmdb/groups`,
    editGroups: `${APIV1}/cmdb/groups/:id`,
    getGroupHosts: `${APIV1}/cmdb/groups/:id/hosts`,
    getCurrentGroups: `${APIV1}/cmdb/:userId/groups`,
    getGroupNodes: `${APIV1}/cmdb/groups/:id/hosts`,
    getNodeInfo: `${APIV1}/cmdb/hosts/:id`,
    getGroupInfo: `${APIV1}/cmdb/groups/:id`,
    searchInventory: `${APIV1}/cmdb/inventory`,
    previewInventory: `${APIV1}/jobs/preview/inventory`,
    getCredentials: `${APIV1}/credentials`,
    addCredential: `${APIV1}/credentials`,
    updateCredential: `${APIV1}/credentials/:id`,
    getBooks: `${APIV1}/books`,
    addBooks: `${APIV1}/books`,
    getPlaybook: `${APIV1}/books/:id/playbook`,
    downloadBook: `${APIV1}/books/:id/download`,
    editFile: `${APIV1}/playbook/:id/file`,
    deleteFile: `${APIV1}/playbook/:id/file`,
    bookDetail: `${APIV1}/books/:id`,
    getApps: `${APIV1}/apps`,
    addApps: `${APIV1}/apps`,
    editApps: `${APIV1}/apps/:id`,
    addJobs: `${APIV1}/jobs`,
    getJobs: `${APIV1}/jobs`,
    checkJob: `${APIV1}/jobs/:id`,
    delJob: `${APIV1}/jobs/:id`,
    getJobDetail: `${APIV1}/jobs/:id`,
    getJobTasks: `${APIV1}/jobs/:id/tasks`,
    getConfig: `${APIV1}/configurations/:id`,
    getConfigs: `${APIV1}/configurations`,
    getPlaybookRegister: `${APIV1}/configurations/:pId/register`,
    addConfigs: `${APIV1}/configurations`,
    listConfig: `${APIV1}/configurations/list/ids`,
    getTaskMonitor: `${APIV1}/tasks`,
    getTaskDetail: `${APIV1}/tasks/:id/info`,
    getTaskLogs: `${APIV1}/tasks/:id/logs`,
    rollbackTask: `${APIV1}/tasks/:id/rollback`,
    deleteTask: `${APIV1}/tasks/:id/:state/remove`,
    getSchedule: `${APIV1}/tasks/:id/schedule`,
    pauseSchedule: `${APIV1}/tasks/:id/schedule/pause`,
    resumeSchedule: `${APIV1}/tasks/:id/schedule/resume`,
    removeSchedule: `${APIV1}/tasks/:id/schedule/remove`,
    reschedule: `${APIV1}/tasks/:id/schedule/reschedule`,
    getQueueTasks: `${APIV1}/tasks/queue`,
    getTaskHistory: `${APIV1}/tasks/history`,
    queryAnsibleDoc: `${APIV1}/jobs/runner/doc`,
    searchModules: `${APIV1}/jobs/runner/modules`,
    console: `${APIV1}/execute`,
    getTeams: `${APIV1}/teams`,
    getTeamInfo: `${APIV1}/teams/:id`,
    updateTeamInfo: `${APIV1}/teams/:id`,
    addUser: `${APIV1}/users`,
    getUserInfo: `${APIV1}/users/:id`,
    updateUser: `${APIV1}/users/:id`,
    sendMail: `${APIV1}/users/email/send`,
    resetPassword: `${APIV1}/users/password/reset`,
    getCurrentRoles: `${APIV1}/users/roles`,
    bindRoles: `${APIV1}/users/:id/roles`,
    bindHosts: `${APIV1}/users/:id/hosts`,
    getRoles: `${APIV1}/roles`,
    addRoles: `${APIV1}/roles`,
    editRoles: `${APIV1}/roles/:id`,
    getRoleMenus: `${APIV1}/roles/:id/menus`,
    getMenus: `${APIV1}/menus`,
    addMenu: `${APIV1}/menus`,
    editMenu: `${APIV1}/menus/:id`,
    getNotifications: `${APIV1}/notifications`,
    markNotifications: `${APIV1}/notifications/read`,
    getLogs: `${APIV1}/logs`,
    jobWebhook: `${APIV1}/webhooks/job`,
    dashboard: `${APIV1}/dashboard`,
    addSetting: `${APIV1}/setting`,
    getSetting: `${APIV1}/setting`,
    getProfile: `${APIV1}/users/:id/profile`,
    saveProfile: `${APIV1}/users/:id/profile`,
    saveAlert: `${APIV1}/users/alert/notification`,
    publicKey: `${APIV1}/sshkeys/public`,
  },
}
